package com.nzw.service.impl.sms;

import com.nzw.dao.alisms.AlismsDao;
import com.nzw.pojo.AliSms;
import com.nzw.service.impl.common.BaseServiceImpl;
import com.nzw.service.sms.AliyunSmsService;
import com.nzw.utils.PageUtil;
import com.nzw.vo.common.HttpResult;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2018/6/7/007.
 */


@Service
public class AliSmsServiceImpl extends BaseServiceImpl implements AliyunSmsService{


    @Override
    public HttpResult getAlismsByPage(Long companyId, int page) {

        Map<String,Object> map = new HashMap<>();
        map.put("companyId",companyId);
        List<AliSms> list = getEntitiesBySort(AliSms.class,map,"id",true);
        return new HttpResult(HttpResult.OK,new PageUtil(page,20,list));
    }

    @Override
    public HttpResult addAliSMS(AliSms alisms) {
        alisms.setCompanyId(1L);
        return new HttpResult(HttpResult.OK,addEntity(alisms));
    }

    @Override
    public HttpResult updateAliSms(AliSms alisms) {

        return new HttpResult(HttpResult.OK,updateEntityValues(alisms));
    }

    @Override
    public HttpResult deleteAliSms(Long smsId) {
        return null;
    }

    @Override
    public HttpResult getAliSmsByCondition(Map<String, Object> map) {


        return null;
    }


}
